package plp.funcoo.dec.parameter;

import plp.funcoo.expressions.Expression;
import plp.funcoo.expressions.ExpressionList;
import plp.funcoo.expressions.Identifier;
import plp.funcoo.util.List;
import plp.funcoo.util.Type;

public class ParameterList extends List<ParameterDeclaration>{
	
	public ParameterList()
	{
		super();
	}

	public ParameterList(ParameterDeclaration parameter)
	{
		super(parameter, new ParameterList());
	}
	
	public ParameterList(ParameterList parameterList)
	{
		super(parameterList.getHead(), parameterList.getTail());
	}
	public ParameterList(ParameterDeclaration parameter, List<ParameterDeclaration> parameterList)
	{
		super(parameter, parameterList);
	}
	public ParameterList(List<ParameterDeclaration> parList)
	{
		super(parList.getHead(),parList.getTail());
	}
	public ParameterList makeCopy()
	{
		return new ParameterList( super.makeCopy());
	}
	public Type searchParameter(Identifier obj)
	{
		if(this.head==null)
			return null;
		else if(this.head.getId().equals(obj))
			return this.head.getType();
		else if(this.tail != null)
			return  (new ParameterList(this.tail.getHead(),this.tail.getTail())).searchParameter(obj);
		else
			return null;
	}
}
